import request from '@/utils/request'

// 获取所有工作站
export function getWorkStation() {
  return request({
    url: '/api/production',
    method: 'get'
  })
}

// 绑定工艺卡
export function bindingWorkStation(processcardCode, stationCode) {
  return request({
    url: `/api/layUp/bingingProcessCard/${processcardCode}/${stationCode}`,
    method: 'get'
  })
}

// 绑定载盘
export function bindingPallet(palletCode, stationCode, flowTo, temp) {
  return request({
    url: `/api/layUp/bindingPallet/${palletCode}/${stationCode}/${flowTo}/${temp}`,
    method: 'get'
  })
}

// 結束生產
export function shutdownLayUp(palletCode) {
  return request({
    url: `/api/layUp/shutdownLayUp/${palletCode}`,
    method: 'get'
  })
}

// 手动获取
export function getMsg(palletCode) {
  return request({
    url: `/api/unbinding/getMsg/${palletCode}`,
    method: 'get'
  })
}

// 上传
export function uploading() {
  return request({
    url: '/api/storage/uploadStorage',
    method: 'get'
  })
}

// 获取叠法图
export function getPicture(workNum) {
  return request({
    responseType: 'blob',
    url: `/api/layUp/openPicture/${workNum}`,
    method: 'get'
  })
}

// 基础信息管理-储位管理-状态修改
export function changeStorageStatus(storageId, storageStatus) {
  return request({
    url: `/api/storage/changeStorageStatus/${storageId}/${storageStatus}`,
    method: 'get'
  })
}

export function getFlowTo() {
  return request({
    url: '/api/layUp/allFlowInfo',
    method: 'get'
  })
}

export function getGelInfoAPI(data) {
  return request({
    url: `/api/gelinfo/getGelInfo/${data.panCode}/${data.stationCode}`,
    method: 'get'
  })
}

export function getGelInfoByIdAPI(data) {
  return request({
    url: `/api/gelinfo/getGelInfoByOrderId/${data.orderId}`,
    method: 'get'
  })
}

export function submitUsageAPI(data) {
  return request({
    url: `/api/gelinfo/commitNum/${data.orderId}/${data.stationCode}/${data.num}`,
    method: 'get'
  })
}

export function coreCodeEditAPI(data) {
  return request({
    url: `/api/gelinfo/coreCodeEdit/${data.coreCode}/${data.operaId}`,
    method: 'get'
  })
}
